//
// Created by admin on 25-6-11.
//

#ifndef FTWINDOW_H
#define FTWINDOW_H

#include <QTableWidget>
#include <QWidget>
#include <QTextEdit>
#include <QTreeWidgetItem>

#include "ImageView.h"


QT_BEGIN_NAMESPACE
namespace Ui { class FtWindow; }
QT_END_NAMESPACE

class FtWindow : public QWidget {
Q_OBJECT

public:
    explicit FtWindow(QWidget *parent = nullptr);
    ~FtWindow() override;
    void initComboxList(QWidget* widget);
    void initTreeWidget(QWidget* widget);
    void initTableWidget(QWidget* widget);
    void initPictureWidget(QWidget* widget);
    void initJsonWidget( QWidget *widget );
    QString size2String(qint64 size);

    void initTableData(  QTableWidget * tableWidget );
    void explorFile(const QString& path, QTreeWidgetItem* rootItem);

    void  initJsonData(QTreeWidgetItem* rootItem, const QJsonValue& value  );
    QString  jsonValueToString(const QJsonValue& value);
    void highlightJsonError(QTextEdit *textEdit, int offset);
private slots:
    void loadPicture();

private:
    Ui::FtWindow *ui;
    ImageView *imageView;
};


#endif //FTWINDOW_H
